﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;

namespace BlogBobby
{
    [ServiceContract]
    public interface IBlogService
    {
        [OperationContract]
        [WebInvoke(Method = "GET", UriTemplate = "/GetPosts/{nn}/{cc}")]
        IEnumerable<PostDTO> RetrievePosts(string nn, string cc);

        [OperationContract]
        [WebInvoke(Method = "GET", UriTemplate = "/GetPostAndComments/{id}/{m}")]
        PostDTO RetrieveSinglePost(string id, string m);

        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "/PostComment",
            BodyStyle = WebMessageBodyStyle.WrappedRequest,
            RequestFormat = WebMessageFormat.Json,
            ResponseFormat = WebMessageFormat.Json)]
            void PostComment(CommentDTO commentToPost);
    }
}
